<!--
 * @Description: 
 * @Date: 2024-05-14 16:37:07
 * @LastEditTime: 2024-06-14 10:49:55
-->
<route lang="json5">
{
  style: {
    navigationBarTitleText: '文章管理',
    navigationBarTextStyle: 'white', //标题栏字体颜色
    navigationBarBackgroundColor: '#0063AF', //标题栏背景色(纯色)
  },
}
</route>
<template>
  <view class="p-30rpx">
    <view class="font-550 mb-20rpx">标题：{{ caseData.title }}</view>
    <view class="mb-20rpx">
      <text class="mr-20rpx">{{ formatTime(caseData.createTime, 'yyyy-MM-dd') }}</text>
      <text>
        文章来源:
        <text class="ml-20rpx">{{ caseData.source }}</text>
      </text>
    </view>
    <view v-html="formatRichText(caseData.content)"></view>
  </view>
</template>
<script setup lang="ts">
import { getWordAPI } from '@/service/index/foo'
import { formatTime, formatRichText } from '@/utils/index'
const { safeAreaInsets } = uni.getSystemInfoSync()
const caseData = ref({
  content: undefined,
  author: undefined,
  source: undefined,
  title: undefined,
  pushTime: undefined,
  imageUrl: undefined,
  createTime: undefined,
})
onLoad((options) => {
  console.log(options)

  getWordAPI(options.id).then((res) => {
    caseData.value = Object.assign(unref(caseData), res.data)
  })
})
const webviewStyles = ref({
  progress: {
    color: '#FF3333',
  },
})
</script>
<style lang="scss" scoped>
img {
  width: 100%;
}
</style>
